<!-- 参考官方文档 -->
<template>
    <view class="">
        <button @click="showActionSheet">弹出</button>
    </view>
</template>

<script lang="ts" setup>
    let data = ['苹果', '橘子', '香蕉', '西瓜'];

    function showActionSheet() {
        //弹出弹窗
        uni.showActionSheet({
            //标题
            title: "请选择",
            //文字数组
            itemList: data,
            //调用成功的回调函数
            success: res => {
                console.log("调用成功", res);
                console.log(data[res.tapIndex]);
            },
            //调用结束的回调函数
            complete: res => {
                console.log("调用结束", res);
            }
        });
    };
</script>

<style lang="scss" scoped>

</style>